'use strict';

const Service = require('../core/common');

class UsersService extends Service {
  findAll(params = {}) {
    const { ctx } = this;

    const about = {
      // include: {
      //   model: ctx.model.Goods
      // },
      // subQuery: false,
      // distinct: false,
      // group: ctx.model.Sequelize.col('Users.id'),
      ...this.paging(params),
    };

    return ctx.model.Users.findAndCountAll(about);
  }

  destroy(params) {
    const { ctx } = this;

    return ctx.model.Users.destroy(params);
  }
}

module.exports = UsersService;